\(\int (c+d x) (a+b \sin (e+f x)) \, dx\) [153]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 45 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}-\frac {b (c+d x) \cos (e+f x)}{f}+\frac {b d \sin (e+f x)}{f^2} \]

[Out]

1/2*a*(d*x+c)^2/d-b*(d*x+c)*cos(f*x+e)/f+b*d*sin(f*x+e)/f^2

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3398, 3377, 2717} \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}-\frac {b (c+d x) \cos (e+f x)}{f}+\frac {b d \sin (e+f x)}{f^2} \]

[In]

Int[(c + d*x)*(a + b*Sin[e + f*x]),x]

[Out]

(a*(c + d*x)^2)/(2*d) - (b*(c + d*x)*Cos[e + f*x])/f + (b*d*Sin[e + f*x])/f^2

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3398

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rubi steps \begin{align*} \text {integral}& = \int (a (c+d x)+b (c+d x) \sin (e+f x)) \, dx \\ & = \frac {a (c+d x)^2}{2 d}+b \int (c+d x) \sin (e+f x) \, dx \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x) \cos (e+f x)}{f}+\frac {(b d) \int \cos (e+f x) \, dx}{f} \\ & = \frac {a (c+d x)^2}{2 d}-\frac {b (c+d x) \cos (e+f x)}{f}+\frac {b d \sin (e+f x)}{f^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.96 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {1}{2} a x (2 c+d x)-\frac {b (c+d x) \cos (e+f x)}{f}+\frac {b d \sin (e+f x)}{f^2} \]

[In]

Integrate[(c + d*x)*(a + b*Sin[e + f*x]),x]

[Out]

(a*x*(2*c + d*x))/2 - (b*(c + d*x)*Cos[e + f*x])/f + (b*d*Sin[e + f*x])/f^2

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.93

method result size
risch \(\frac {d a \,x^{2}}{2}+a c x -\frac {b \left (d x +c \right ) \cos \left (f x +e \right )}{f}+\frac {b d \sin \left (f x +e \right )}{f^{2}}\) \(42\)
parallelrisch \(\frac {-\left (d x +c \right ) b f \cos \left (f x +e \right )+\sin \left (f x +e \right ) b d +\left (a x \left (\frac {d x}{2}+c \right ) f -c b \right ) f}{f^{2}}\) \(47\)
parts \(a \left (\frac {1}{2} d \,x^{2}+c x \right )+\frac {b \left (\frac {d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-c \cos \left (f x +e \right )+\frac {d e \cos \left (f x +e \right )}{f}\right )}{f}\) \(66\)
derivativedivides \(\frac {a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}-c b \cos \left (f x +e \right )+\frac {b d e \cos \left (f x +e \right )}{f}+\frac {b d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}}{f}\) \(90\)
default \(\frac {a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}-c b \cos \left (f x +e \right )+\frac {b d e \cos \left (f x +e \right )}{f}+\frac {b d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}}{f}\) \(90\)
norman \(\frac {\frac {2 c b \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {\left (a c f -b d \right ) x}{f}+\frac {\left (a c f +b d \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {d a \,x^{2}}{2}+\frac {2 b d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}+\frac {d a \,x^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}\) \(115\)

[In]

int((d*x+c)*(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/2*d*a*x^2+a*c*x-b*(d*x+c)*cos(f*x+e)/f+b*d*sin(f*x+e)/f^2

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.13 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {a d f^{2} x^{2} + 2 \, a c f^{2} x + 2 \, b d \sin \left (f x + e\right ) - 2 \, {\left (b d f x + b c f\right )} \cos \left (f x + e\right )}{2 \, f^{2}} \]

[In]

integrate((d*x+c)*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(a*d*f^2*x^2 + 2*a*c*f^2*x + 2*b*d*sin(f*x + e) - 2*(b*d*f*x + b*c*f)*cos(f*x + e))/f^2

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.51 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\begin {cases} a c x + \frac {a d x^{2}}{2} - \frac {b c \cos {\left (e + f x \right )}}{f} - \frac {b d x \cos {\left (e + f x \right )}}{f} + \frac {b d \sin {\left (e + f x \right )}}{f^{2}} & \text {for}\: f \neq 0 \\\left (a + b \sin {\left (e \right )}\right ) \left (c x + \frac {d x^{2}}{2}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((d*x+c)*(a+b*sin(f*x+e)),x)

[Out]

Piecewise((a*c*x + a*d*x**2/2 - b*c*cos(e + f*x)/f - b*d*x*cos(e + f*x)/f + b*d*sin(e + f*x)/f**2, Ne(f, 0)),
((a + b*sin(e))*(c*x + d*x**2/2), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 93 vs. \(2 (43) = 86\).

Time = 0.20 (sec) , antiderivative size = 93, normalized size of antiderivative = 2.07 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {2 \, {\left (f x + e\right )} a c + \frac {{\left (f x + e\right )}^{2} a d}{f} - \frac {2 \, {\left (f x + e\right )} a d e}{f} - 2 \, b c \cos \left (f x + e\right ) + \frac {2 \, b d e \cos \left (f x + e\right )}{f} - \frac {2 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} b d}{f}}{2 \, f} \]

[In]

integrate((d*x+c)*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*(f*x + e)*a*c + (f*x + e)^2*a*d/f - 2*(f*x + e)*a*d*e/f - 2*b*c*cos(f*x + e) + 2*b*d*e*cos(f*x + e)/f -
 2*((f*x + e)*cos(f*x + e) - sin(f*x + e))*b*d/f)/f

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=\frac {1}{2} \, a d x^{2} + a c x + \frac {b d \sin \left (f x + e\right )}{f^{2}} - \frac {{\left (b d f x + b c f\right )} \cos \left (f x + e\right )}{f^{2}} \]

[In]

integrate((d*x+c)*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*a*d*x^2 + a*c*x + b*d*sin(f*x + e)/f^2 - (b*d*f*x + b*c*f)*cos(f*x + e)/f^2

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.11 \[ \int (c+d x) (a+b \sin (e+f x)) \, dx=a\,c\,x-\frac {f\,\left (b\,c\,\cos \left (e+f\,x\right )+b\,d\,x\,\cos \left (e+f\,x\right )\right )-b\,d\,\sin \left (e+f\,x\right )}{f^2}+\frac {a\,d\,x^2}{2} \]

[In]

int((a + b*sin(e + f*x))*(c + d*x),x)

[Out]

a*c*x - (f*(b*c*cos(e + f*x) + b*d*x*cos(e + f*x)) - b*d*sin(e + f*x))/f^2 + (a*d*x^2)/2